/* NOTICE
    OpenJaWS - Open Java Weather Station
    
    Copyright (C) 2008 Grant Gardner <grant@lastweekend.com.au>
    
    OpenJaWS is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
    
NOTICE */

package au.com.lastweekend.openjaws.web;

import java.util.Date;

import au.com.lastweekend.openjaws.api.CurrentMinMax;
import au.com.lastweekend.openjaws.api.Readings;
import au.com.lastweekend.openjaws.api.WindCurrentMinMax;
import au.com.lastweekend.openjaws.units.PercentUnit;
import au.com.lastweekend.openjaws.units.PressureUnit;
import au.com.lastweekend.openjaws.units.RainfallUnit;
import au.com.lastweekend.openjaws.units.TemperatureUnit;
import au.com.lastweekend.openjaws.units.WindUnit;

public class StaticStation implements WebStation {

    public String getName() {

        return "A Static Station";
    }

    public Readings fetchReadings() {

        Readings result = new Readings();
        result.setReadingTime(new Date());

        CurrentMinMax temp = result.getIndoorTemperature();
        temp.setCurrent(34, TemperatureUnit.CELSIUS);
        temp.setMaximum(45, TemperatureUnit.CELSIUS, new Date());
        temp.setMinimum(12, TemperatureUnit.CELSIUS, new Date());

        temp = result.getOutdoorTemperature();
        temp.setCurrent(34, TemperatureUnit.CELSIUS);
        temp.setMaximum(45, TemperatureUnit.CELSIUS, new Date());
        temp.setMinimum(12, TemperatureUnit.CELSIUS, new Date());

        temp = result.getIndoorHumidity();
        temp.setCurrent(87, PercentUnit.PERCENT);
        temp.setMaximum(99.9, PercentUnit.PERCENT, new Date());
        temp.setMinimum(5, PercentUnit.PERCENT, new Date());

        temp = result.getAirPressure();
        temp.setCurrent(1001.4, PressureUnit.HECTOPASCAL);
        temp.setMaximum(1010.2, PressureUnit.HECTOPASCAL, new Date());
        temp.setMinimum(1003.5, PressureUnit.HECTOPASCAL, new Date());

        temp = result.getRain1H();
        temp.setCurrent(3.3, RainfallUnit.MILLIMETRE);
        temp.setMaximum(35.2, RainfallUnit.MILLIMETRE, new Date());

        temp = result.getRain24H();
        temp.setCurrent(33.3, RainfallUnit.MILLIMETRE);
        temp.setMaximum(335.2, RainfallUnit.MILLIMETRE, new Date());

        WindCurrentMinMax wind = result.getWindSpeed();
        wind.setCurrent(10, WindUnit.KILOMETRES_PER_HOUR, 0);
        wind.setMaximum(120.0, WindUnit.KILOMETRES_PER_HOUR, 11.0, new Date());

        return result;

    }

}
